//
//  PickerManager.h
//
//
//  Created by ChenJianWei on 16/8/10
//
//

#import <UIKit/UIKit.h>

typedef void (^PickerManagerConfirmBlock)(NSArray *arr);
typedef void (^PickerManagerCancelBlock)(NSArray *arr);
typedef void (^PickerManagerSlideBlock)(NSArray *arr);

@interface DTPickerManager : NSObject

@property (strong, nonatomic) NSArray *dataArray;
@property (strong, nonatomic) NSArray *noticeArray;

+ (DTPickerManager *)shareManager;

- (void)showPickerAndCancel:(PickerManagerCancelBlock)cancelBlock andConfirm:(PickerManagerConfirmBlock)confirmBlock;

- (void)showPickerAndCancel:(PickerManagerCancelBlock)cancelBlock andConfirm:(PickerManagerConfirmBlock)confirmBlock andSlideBlock:(PickerManagerSlideBlock)slideBlock;

- (void)hidePicker;
- (void)showLocationByValue:(NSArray *)valueList;
- (void)showLocationByDate:(NSDate *)date;

- (void)showDate:(NSDate *)date pickerWithBirthDayAndPicker:(PickerManagerCancelBlock)cancelBlock andConfirm:(PickerManagerConfirmBlock)confirmBlock;

- (void)showPickerWithWeightAndPicker:(PickerManagerCancelBlock)cancelBlock andConfirm:(PickerManagerConfirmBlock)confirmBlock;
- (void)showPickerWithHeightAndPicker:(PickerManagerCancelBlock)cancelBlock andConfirm:(PickerManagerConfirmBlock)confirmBlock;
- (void)showPickerWithSexAndPicker:(PickerManagerCancelBlock)cancelBlock andConfirm:(PickerManagerConfirmBlock)confirmBlock;
- (void)showPickerWithAfterSalesTypeAndPicker:(PickerManagerCancelBlock)cancelBlock andConfirm:(PickerManagerConfirmBlock)confirmBlock;
- (void)showPickerWithAgeAndPicker:(PickerManagerCancelBlock)cancelBlock andConfirm:(PickerManagerConfirmBlock)confirmBlock;
- (void)showPickerWithTypeAndPicker:(PickerManagerCancelBlock)cancelBlock andConfirm:(PickerManagerConfirmBlock)confirmBlock;
- (void)showPickerWithTimeAndPicker:(PickerManagerCancelBlock)cancelBlock andConfirm:(PickerManagerConfirmBlock)confirmBlock;


- (void)showPickerWithMax:(int)max min:(int)min notice:(NSString *)notice picker:(PickerManagerCancelBlock)cancelBlock andConfirm:(PickerManagerConfirmBlock)confirmBlock;

- (void)showDate:(NSDate *)date pickerWithFutureDateAndPicker:(PickerManagerCancelBlock)cancelBlock andConfirm:(PickerManagerConfirmBlock)confirmBlock;

- (void)showDate:(NSDate *)date pickerWithTimeAndPicker:(PickerManagerCancelBlock)cancelBlock andConfirm:(PickerManagerConfirmBlock)confirmBlock;

- (void)showWaterType:(NSInteger)type pickerWithTimeAndPicker:(PickerManagerCancelBlock)cancelBlock andConfirm:(PickerManagerConfirmBlock)confirmBlock;

@end

/**
 *  用例
 */

/**
 *      
 [DTPickerManager shareManager].noticeArray = @[@"时",@"分",@"秒",@"毫",@"秒",@"秒",@"毫",@"秒"];
 [DTPickerManager shareManager].dataArray = @[@[@"1",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2"],@[@"3",@"4",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2"],@[@"9",@"10",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2"],@[@"9",@"10",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2"],@[@"9",@"10",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2"],@[@"9",@"10",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2"],@[@"9",@"10",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2"],@[@"9",@"10",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2",@"2"]];
 
 //    [[DTPickerManager shareManager]showPickerAndCancel:^(NSArray *arr) {
 //        NSLog(@"cancel === %@",arr);
 //    } andConfirm:^(NSArray *arr) {
 //        NSLog(@"confirm === %@",arr);
 //    }];
 
 [[DTPickerManager shareManager]showPickerAndCancel:^(NSArray *arr) {
 NSLog(@"cancel === %@",arr);
 } andConfirm:^(NSArray *arr) {
 NSLog(@"confirm === %@",arr);
 } andSlideBlock:^(NSArray *arr) {
 NSLog(@"slide === %@",arr);
 }];
 */
